import { axios } from '@/utils/request'

// 商品分类列表
export const getProductCategoryList = () => {
  return axios({
    url: '/productCategory',
    method: 'get'
  })
}

// 商品分类详情
export const getProductCategoryDetails = (id) => {
  return axios({
    url: `/productCategory/${id}`,
    method: 'get'
  })
}

// 新建商品分类
export const createProductCategory = (data) => {
  return axios({
    url: '/productCategory',
    method: 'post',
    data
  })
}

// 更新商品分类
export const updateProductCategory = (id, data) => {
  return axios({
    url: `/productCategory/${id}`,
    method: 'put',
    data
  })
}

export const deleteProductCategory = (id) => {
  return axios({
    url: `/productCategory/${id}`,
    method: 'delete'
  })
}